package com.wrupple.muba.catalogs.client.widgets.fields.providers;

import com.google.gwt.cell.client.Cell;
import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.wrupple.muba.catalogs.client.activity.process.state.ContentLoadingState;
import com.wrupple.muba.catalogs.client.activity.process.task.CatalogInteractionState.Mode;
import com.wrupple.muba.catalogs.client.cms.service.CatalogManagementSystem;
import com.wrupple.muba.catalogs.client.module.services.presentation.CatalogFormFieldProvider;
import com.wrupple.muba.catalogs.client.widgets.fields.cells.GenericKeyCell;
import com.wrupple.muba.common.shared.State.ProcessManager;
import com.wrupple.vegetate.domain.FieldDescriptor;

public class GenericKeyCellProvider implements CatalogFormFieldProvider {

	private CatalogManagementSystem cms;
	private Provider<ContentLoadingState> contentLoadingState;

	@Inject
	public GenericKeyCellProvider(CatalogManagementSystem cms,
			Provider<ContentLoadingState> contentLoadingState) {
		super();
		this.cms = cms;
		this.contentLoadingState = contentLoadingState;
	}


	@Override
	public Cell<String> createCell(EventBus bus, ProcessManager pm,
			FieldDescriptor d, Mode mode) {
		return new GenericKeyCell(bus, pm, d, mode, cms, contentLoadingState);
	}

}
